function initCalendar(calendarPath)
{
	if(!calendarPath) calendarPath="calendar.htm";
	var downloadObj=document.createElement("IE:Download");
	downloadObj.id="dwn";
	downloadObj.addBehavior("#default#download");
	var oPopup = self.createPopup();
        //The callback function pointer takes a single parameter. When a file downloads successfully, the file contents are passed as the parameter and are accessible in script.
        //startDownload is a member of the download default behavior.
	downloadObj.startDownload(calendarPath,onDone);
	return oPopup;
}


function onDone(src)
{
	oPopup.document.write(src); 
}

function showCalendar()
{
	var pickerIMG=window.event.srcElement
	var pickerBOX=pickerIMG.parentElement.previousSibling.children[0];
	var srcIndex=pickerBOX.sourceIndex;
	var offset_left=pickerIMG.offsetLeft-177;
	var offset_top=pickerIMG.offsetTop+pickerIMG.offsetHeight;
	var parentObj;
	
	parentObj=pickerIMG;
	while(parentObj && parentObj.tagName!="BODY")
	{
		offset_left+=parentObj.offsetLeft;
		offset_top+=parentObj.offsetTop;
		parentObj=parentObj.offsetParent;
	}
	offset_left+=self.screenLeft;
	offset_top+=self.screenTop;
	
	oPopup.document.title=srcIndex;
//	alert(srcIndex);
//	oPopup.document.fireEvent("onfocusin");
	oPopup.show(offset_left,offset_top,177,182);
}